{% load staticfiles %}
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1 , user-scalable=no">
  <TITLE>查看老师详情</TITLE>
  <link href="{% static 'plugins/bootstrap.css' %}" rel="stylesheet">
  <link href="{% static 'plugins/bootstrap-dashen.css' %}" rel="stylesheet">
  <link href="{% static 'plugins/font-awesome.css' %}" rel="stylesheet">
  <link href="{% static 'plugins/animate.css' %}" rel="stylesheet">
</head>
<body style="margin-top:70px;"> 
{% include 'header.html' %}
<div class="container">
	<ul class="breadcrumb">
  		<li><a href={% url 'Index:index' %}">首页</a></li>
  		<li><a href="{% url 'Teacher:frontList' %}">老师信息</a></li>
  		<li class="active">详情查看</li>
	</ul>
	<div class="row bottom15"> 
		<div class="col-md-2 col-xs-4 text-right bold">教师编号:</div>
		<div class="col-md-10 col-xs-6">{{ teacher.teacherNo }}</div>
	</div>

	<div class="row bottom15"> 
		<div class="col-md-2 col-xs-4 text-right bold">姓名:</div>
		<div class="col-md-10 col-xs-6">{{ teacher.name }}</div>
	</div>
	<div class="row bottom15"> 
		<div class="col-md-2 col-xs-4 text-right bold">性别:</div>
		<div class="col-md-10 col-xs-6">{{ teacher.sex }}</div>
	</div>
	<div class="row bottom15"> 
		<div class="col-md-2 col-xs-4 text-right bold">出生日期:</div>
		<div class="col-md-10 col-xs-6">{{ teacher.birthDate }}</div>
	</div>
	<div class="row bottom15"> 
		<div class="col-md-2 col-xs-4 text-right bold">老师照片:</div>
		<div class="col-md-10 col-xs-6"><img class="img-responsive" src="{{ teacher.teacherPhoto.url }}"  border="0px"/></div>
	</div>
	<div class="row bottom15"> 
		<div class="col-md-2 col-xs-4 text-right bold">职称:</div>
		<div class="col-md-10 col-xs-6">{{ teacher.zhicheng }}</div>
	</div>
	<div class="row bottom15"> 
		<div class="col-md-2 col-xs-4 text-right bold">联系电话:</div>
		<div class="col-md-10 col-xs-6">{{ teacher.telephone }}</div>
	</div>
	<div class="row bottom15"> 
		<div class="col-md-2 col-xs-4 text-right bold">入职日期:</div>
		<div class="col-md-10 col-xs-6">{{ teacher.comeDate }}</div>
	</div>
	<div class="row bottom15"> 
		<div class="col-md-2 col-xs-4 text-right bold">家庭地址:</div>
		<div class="col-md-10 col-xs-6">{{ teacher.address }}</div>
	</div>
	<div class="row bottom15"> 
		<div class="col-md-2 col-xs-4 text-right bold">老师介绍:</div>
		<div class="col-md-10 col-xs-6">{{ teacher.teacherDesc | safe  }}</div>
	</div>
	<div class="row bottom15">
		<div class="col-md-2 col-xs-4"></div>
		<div class="col-md-6 col-xs-6">
			<button onclick="viewResource();" class="btn btn-primary">查看他的资源</button>
            <button onclick="teacherFollow();" class="btn btn-primary">订阅老师</button>
		</div>
	</div>
</div>
{% csrf_token %}
{% include 'footer.html' %}
<script src="{% static 'plugins/jquery.min.js' %}"></script>
<script src="{% static 'plugins/bootstrap.js' %}"></script>
<script src="{% static 'plugins/wow.min.js' %}"></script>
<script>
function viewResource() {
    location.href = '/Resource/frontList?teacherObj.teacherNo={{ teacher.teacherNo }}';
}


function teacherFollow() {
    $.ajax({
		url : "/TeacheFollow/userFrontAdd",
		type : "post",
		dataType: "json",
		data: {
			"teacheFollow.teacherObj.teacherNo": "{{teacher.teacherNo }}",
            "csrfmiddlewaretoken": $('input[name="csrfmiddlewaretoken"]').val()
		},
		success : function (data, response, status) {
			//var obj = jQuery.parseJSON(data);
			if(data.success){
				alert("订阅成功~");
				location.reload();
			}else{
				alert(data.message);
			}
		}
	});
}

$(function(){
        /*小屏幕导航点击关闭菜单*/
        $('.navbar-collapse a').click(function(){
            $('.navbar-collapse').collapse('hide');
        });
        new WOW().init();
 })
 </script> 
</body>
</html>

